package com.ss.android.article.base.feature.detail2.a.c;

import com.bytedance.common.utility.Logger;
import com.ss.android.article.base.feature.detail2.widget.ProgressTextView;
import com.ss.android.article.base.feature.detail2.widget.ProgressTextView.Status;
import com.ss.android.common.download.DownloadShortInfo;
import com.ss.android.common.util.ToolUtils;

final class b implements Runnable {
    private final DetailAdGroupPicLayout e;
    private final long a;
    private final long b;
    private final int c;
    private final DownloadShortInfo d;

    b(DetailAdGroupPicLayout arg1, long arg2, long arg4, int arg6, DownloadShortInfo arg7) {
        this.e = arg1;
        this.a = arg2;
        this.b = arg4;
        this.c = arg6;
        this.d = arg7;
    }

    public final void run() {
        float v0 = (((float) this.a)) / (((float) this.b));
        if (this.c == 1) {
            this.e.a.setStatus(ProgressTextView.Status.DOWNLOADING);
            this.e.a.setProgress(v0);
        } else if (this.c == 2) {
            this.e.a.setStatus(Status.PAUSING);
            this.e.a.setProgress(v0);
        } else if (this.c != 3) {
            Logger.d("DetailAdGroupPicLayout", "download short info error!");
        } else if (this.d.b == 16) {
            this.e.a.setStatus(Status.FAILURE);
        } else if (this.d.b == 8) {
            if (ToolUtils.isAppInstalled(this.e.getContext(), this.e.d)) {
                this.e.a.setStatus(Status.FINISH_OPEN);
            } else {
                this.e.a.setStatus(Status.FINISH_INSTALL);
            }
        }
    }
}

